package com.wu.qqclient.service;


import java.util.concurrent.ConcurrentHashMap;


/*
用来管理我们的客户端连接服务端的线程的类
 */
public class ManageClientConnectServerThread {

    //我们把多个线程放入到hashMap中  key用用户ID  value就是线程
    private static ConcurrentHashMap<String,ClientConnectServerThread> hm = new ConcurrentHashMap<>();


    //将某个线程加入集合
    public static void addClientConnectServerThread(String userId,
                                                    ClientConnectServerThread connectServerThread){
        hm.put(userId, connectServerThread);
    }

    //通过Userid将某个线程取出
    public static ClientConnectServerThread getClientConnectServerThread(String userId){
        return hm.get(userId);
    }

}
